/*=============================================================================
# FileName    :	udp_user_top.v
# Author      :	author
# Email       :	email@email.com
# Description :	
# Version     :	1.0
# LastChange  :	2018-08-27 14:05:19
# ChangeLog   :	
=============================================================================*/
`timescale  1 ns/1 ps

module udp_user_top #
(
    parameter C_CLK_FREQ_HZ     = 125_000_000    // AXI接口用户时钟
)
(
    input                       clk,
    input                       rst,

    // 接受的 udp 数据帧，送到rx模块进行解析
    input        [47:00]        s_axis_tsrcmac,
    input        [31:00]        s_axis_tsrcip,
    input        [07:00]        s_axis_tdata,
    input                       s_axis_tvalid,
    input                       s_axis_tlast,

    output       [31:00]        load_parameter,
    output       [07:00]        load_m_axi_tdata,
    output                      load_m_axi_tvalid,
    input                       load_m_axi_tready,
    output                      load_m_axi_tlast,

    //
    output       [47:00]        m_axis_tdstmac,
    output       [31:00]        m_axis_tdstip,
    output       [10:00]        m_axis_tlen,
    output       [07:00]        m_axis_tdata,
    output                      m_axis_tvalid,
    input                       m_axis_tready,
    output                      m_axis_tlast,
                
    input        [31:00]        update_paramter,
    input        [07:00]        update_m_axi_tdata,
    input                       update_m_axi_tvalid,
    output                      update_m_axi_tready,
    input                       update_m_axi_tlast
);

wire    [47:00]             rx_udp_srcmac;
wire    [31:00]             rx_udp_srcip;

udp_user_rx #
(
    .C_CLK_FREQ_HZ          (    125_000_000            )
)
udp_user_rxEx01
(
    .clk                    (    clk                    ),
    .rst                    (    rst                    ),
    .s_axis_tsrcmac         (    s_axis_tsrcmac         ),
    .s_axis_tsrcip          (    s_axis_tsrcip          ),
    .s_axis_tdata           (    s_axis_tdata           ),
    .s_axis_tvalid          (    s_axis_tvalid          ),
    .s_axis_tlast           (    s_axis_tlast           ),
    .rx_udp_srcmac          (    rx_udp_srcmac          ),
    .rx_udp_srcip           (    rx_udp_srcip           ),

    .load_parameter         (    load_parameter         ),
    .load_m_axi_tdata       (    load_m_axi_tdata       ),
    .load_m_axi_tvalid      (    load_m_axi_tvalid      ),
    .load_m_axi_tready      (    load_m_axi_tready      ),
    .load_m_axi_tlast       (    load_m_axi_tlast       )

);

udp_user_tx udp_user_txEx01
(
    .clk                    (    clk                    ),
    .rst                    (    rst                    ),
    .update_paramter        (    update_paramter        ),
    .update_m_axi_tdata     (    update_m_axi_tdata     ),
    .update_m_axi_tvalid    (    update_m_axi_tvalid    ),
    .update_m_axi_tready    (    update_m_axi_tready    ),
    .update_m_axi_tlast     (    update_m_axi_tlast     ),

    .rx_udp_srcmac          (    rx_udp_srcmac          ),
    .rx_udp_srcip           (    rx_udp_srcip           ),

    .m_axis_tdstmac         (    m_axis_tdstmac         ),
    .m_axis_tdstip          (    m_axis_tdstip          ),
    .m_axis_tlen            (    m_axis_tlen            ),
    .m_axis_tdata           (    m_axis_tdata           ),
    .m_axis_tvalid          (    m_axis_tvalid          ),
    .m_axis_tready          (    m_axis_tready          ),
    .m_axis_tlast           (    m_axis_tlast           )
);
endmodule
